/*This module is a tool to store data locally*/

import store from 'store'
const USER_KEY = 'user_key'

export default {
  saveUser(user){
    store.set(USER_KEY,user)
  },
  getUser(){
    return store.get(USER_KEY) || {}
  },
  removeUser(){
    store.remove(USER_KEY)
  }
}

/* from https://github.com/marcuswestin/store.js
// Store current user
store.set('user', { name:'Marcus' })

// Get current user
store.get('user')

// Remove current user
store.remove('user')

// Clear all keys
store.clearAll()

// Loop over all stored values
store.each(function(value, key) {
	console.log(key, '==', value)
})
*/